/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package za.ac.cput.inheritance.inheritanceviolation.subclass;

import za.ac.cput.inheritance.inheritanceviolation.superclass.StudentInformation;

/**
 *
 * @author given
 */
public class UpdateStudent extends StudentInformation{

    public UpdateStudent(String name, String surname, String studNum) {
        super(name, surname, studNum);
    }
    
    public void changeName(String n){        
            this.name = n; ///child cannot access a private member of a super class        
    }    
    
    @Override
    public String toString(){
        return "Student number: " + getStudNum() +"\nName: " + getName() + "\nSurname: " + getSurname();
    }
}
